package com.aiyige.utils;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;

import com.aiyige.R;

public class DialogUtil {
    public static AlertDialog makeConfirmExitDialog(final Activity activity, int msgResId, int okResId, int cancelResId) {
        return new AlertDialog.Builder(activity)
                .setMessage(msgResId)
                .setPositiveButton(okResId, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        activity.finish();
                    }
                })
                .setNegativeButton(cancelResId, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .create();
    }


}
